package com.isoft.systemprovidor.controller.perinfor;

import com.isoft.systemprovidor.bean.ResponseData;
import com.isoft.systemprovidor.controller.BaseController;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Relative_Criminal;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Relative_Familynember;
import com.isoft.systemprovidor.service.perinfor.Perinfor_Relative_Criminal_Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemprovidor/criminal")
public class Perinfor_Relative_Criminal_Controller extends BaseController {
    @Autowired
    Perinfor_Relative_Criminal_Service service;


    /*验证身份证号*/
    @GetMapping("/idcardisexist")
    public ResponseData idcardIsExist(String idcard){
        return service.idcardIsExist(idcard);
    }

    /*查看家庭主要成员的形式责任信息*/
    @GetMapping("/get")
    public ResponseData selectCriminal(String sysuserid){
        return service.selectCriminal(sysuserid);
    }
    /*修改家庭主要成员的形式责任信息*/
    @PutMapping("/update")
    public ResponseData<Boolean> changeCriminal( @RequestBody Perinfor_Relative_Criminal criminal){
        return returnBoolean(service.changeCriminal(criminal));
    }
    /*添加家庭主要成员的形式责任信息*/
    @PostMapping("/add")
    public ResponseData<Object> insertCriminal(Perinfor_Relative_Criminal criminal){
        return returnObject(service.insertCriminal(criminal));
    }
    /*删除家庭主要成员的形式责任信息（逻辑删除）*/
    @GetMapping("/islock")
    public ResponseData<Boolean> islockCriminal(Integer id ,String sysuserid){
        return returnBoolean(service.islockCriminal(id , sysuserid));
    }
}
